package com.dating.view;

import android.content.Context;
import android.graphics.Canvas;
import android.location.Location;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

public class DtOverlay extends MyLocationOverlay {
	Context context;
	MapView mMap;

	public DtOverlay(Context context, MapView mapView) {
		super(context, mapView);
		this.context = context;
		this.mMap = mapView;
	}

	public void animatedTo(Location l) {
		if (l != null) {
			GeoPoint p = new GeoPoint((int) (l.getLatitude() * 1E6),
					(int) (l.getLongitude() * 1E6));
			mMap.getController().animateTo(p);
			mMap.getController().setZoom(16);
		}
	}
	
	@Override
	protected void drawCompass(Canvas canvas, float bearing) {
//		Bitmap arrowBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.compass);
//		Matrix matrix = new Matrix();
//		matrix.postRotate(bearing);
//		Bitmap rotatedBmp = Bitmap.createBitmap(arrowBitmap, 0, 0,
//				arrowBitmap.getWidth(), arrowBitmap.getHeight(), matrix, true);
//
//		canvas.drawBitmap(rotatedBmp, 20, 20, null);
		super.drawCompass(canvas, bearing);
	}
}
